<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Gets the Decomposition_Mapping property for the given UTF-8 encoded code point</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="class.normalizer.html">« Normalizer</a></li>
      <li style="float: right;"><a href="normalizer.isnormalized.html">Normalizer::isNormalized »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.normalizer.html">Normalizer</a></li>
    <li>Gets the Decomposition_Mapping property for the given UTF-8 encoded code point</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="normalizer.getrawdecomposition" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Normalizer::getRawDecomposition</h1>
  <h1 class="refname">normalizer_get_raw_decomposition</h1>
  <p class="verinfo">(PHP 7 &gt;= 7.3, PHP 8)</p><p class="refpurpose"><span class="refname">Normalizer::getRawDecomposition</span> -- <span class="refname">normalizer_get_raw_decomposition</span> &mdash; <span class="dc-title">Gets the Decomposition_Mapping property for the given UTF-8 encoded code point</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-normalizer.getrawdecomposition-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格</p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><strong>Normalizer::getRawDecomposition</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$string</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$form</code><span class="initializer"> = Normalizer::FORM_C</span></span>): <span class="type"><span class="type">?</span><span class="type">string</span></span></div>


  <p class="para rdfs-comment">过程化风格</p>
  <div class="methodsynopsis dc-description"><span class="methodname"><strong>normalizer_get_raw_decomposition</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$string</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$form</code><span class="initializer"> = Normalizer::FORM_C</span></span>): <span class="type"><span class="type">?</span><span class="type">string</span></span></div>


  <p class="para rdfs-comment">
   Gets the Decomposition_Mapping property, as specified in the
   Unicode Character Database (UCD), for the given UTF-8 encoded code point.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-normalizer.getrawdecomposition-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">string</code></dt>

    <dd>

     <p class="para">
      The input string, which should be a single, UTF-8 encoded, code point.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-normalizer.getrawdecomposition-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a <span class="type">string</span> containing the Decomposition_Mapping property, if present in the UCD.
  </p>
  <p class="para">
   Returns <strong><code>null</code></strong> if there is no Decomposition_Mapping property for the character.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-normalizer.getrawdecomposition-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="normalizer.getrawdecomposition.example.basic">
   <p><strong>示例 #1 <span class="methodname"><strong>Normalizer::getRawDecomposition()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">""</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$strings&nbsp;</span><span style="color: #007700">=&nbsp;[<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"a"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"\u{FFDA}"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"\u{FDFA}"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">""</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"aa"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"\xF5"</span><span style="color: #007700">,<br />];<br /><br />foreach&nbsp;(</span><span style="color: #0000BB">$strings&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$string</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$decomposition&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">Normalizer</span><span style="color: #007700">::</span><span style="color: #0000BB">getRawDecomposition</span><span style="color: #007700">(</span><span style="color: #0000BB">$string</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;$decomposition&nbsp;=&nbsp;normalizer_get_raw_decomposition($string);&nbsp;Procedural&nbsp;way<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$error_code&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">intl_get_error_code</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$error_message&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">intl_get_error_message</span><span style="color: #007700">();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$string_hex&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">bin2hex</span><span style="color: #007700">(</span><span style="color: #0000BB">$string</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">.=&nbsp;</span><span style="color: #DD0000">"---------------------\n"</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">$decomposition&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">.=&nbsp;</span><span style="color: #DD0000">"'</span><span style="color: #0000BB">$string_hex</span><span style="color: #DD0000">'&nbsp;has&nbsp;no&nbsp;decomposition&nbsp;mapping\n"&nbsp;</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">.=&nbsp;</span><span style="color: #DD0000">"'</span><span style="color: #0000BB">$string_hex</span><span style="color: #DD0000">'&nbsp;has&nbsp;the&nbsp;decomposition&nbsp;mapping&nbsp;'"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">bin2hex</span><span style="color: #007700">(</span><span style="color: #0000BB">$decomposition</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"'\n"&nbsp;</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">.=&nbsp;</span><span style="color: #DD0000">"error&nbsp;info:&nbsp;'</span><span style="color: #0000BB">$error_message</span><span style="color: #DD0000">'&nbsp;(</span><span style="color: #0000BB">$error_code</span><span style="color: #DD0000">)\n"</span><span style="color: #007700">;<br />}<br /><br />echo&nbsp;</span><span style="color: #0000BB">$result</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

   <div class="example-contents"><p>以上例程会输出：</p></div>
   <div class="example-contents screen">
<div class="cdata"><pre>
---------------------
&#039;61&#039; has no decomposition mapping
error info: &#039;U_ZERO_ERROR&#039; (0)
---------------------
&#039;efbf9a&#039; has the decomposition mapping &#039;e385a1&#039;
error info: &#039;U_ZERO_ERROR&#039; (0)
---------------------
&#039;efb7ba&#039; has the decomposition mapping &#039;d8b5d984d98920d8a7d984d984d98720d8b9d984d98ad98720d988d8b3d984d985&#039;
error info: &#039;U_ZERO_ERROR&#039; (0)
---------------------
&#039;&#039; has no decomposition mapping
error info: &#039;Input string must be exactly one UTF-8 encoded code point long.: U_ILLEGAL_ARGUMENT_ERROR&#039; (1)
---------------------
&#039;6161&#039; has no decomposition mapping
error info: &#039;Input string must be exactly one UTF-8 encoded code point long.: U_ILLEGAL_ARGUMENT_ERROR&#039; (1)
---------------------
&#039;f5&#039; has no decomposition mapping
error info: &#039;Code point out of range: U_ILLEGAL_ARGUMENT_ERROR&#039; (1)
</pre></div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-normalizer.getrawdecomposition-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="methodname"><a href="normalizer.normalize.html" class="methodname" rel="rdfs-seeAlso">Normalizer::normalize()</a> - Normalizes the input provided and returns the normalized string</span></li>
   <li class="member"><span class="methodname"><a href="normalizer.isnormalized.html" class="methodname" rel="rdfs-seeAlso">Normalizer::isNormalized()</a> - Checks if the provided string is already in the specified normalization
   form</span></li>
  </ul>
 </div>


</div></div></div></body></html>